<?php $this->load->module('inc/home_made/jrheadercommon') ?>
	<!-- 内容 -->
	<section class="content">
		<aside>
			<div>
				<?php $this->load->module('inc/home_made/broadcastmod'); ?>
				<?php $this->load->module('inc/home_made/salemod'); ?>
				
			</div>
		</aside>
		<div class="c_body clearfix">
			<div class="c_intro">
				<h3 class="radius"><div class="r_r"><div class="r_c">查看留言</div></div></h3>
				<div class="help_div2">
					<div>
						<?php
						if($data){
							foreach ($data as $key => $value) {
								
								echo "<div style='margin-bottom:10px;border:1px solid #a2d2c2;width:90%'>";
								echo "<div style='padding:4px 14px;background:#FFFBCC;color:#9a2e1d'>";
								echo $value->name, '&nbsp;&nbsp;[发布：', $value->name, ']', '[发布时间:',$value->createtime,']';
								echo "</div>";
								echo "<div style='padding:4px 14px;'>";
								echo $value->title;
								echo "</div>";
								echo "</div>";

							}

							echo $pagination;
						}else{
							echo "还没有留言";
						}
						?>
					</div>
					<p>如果您有任何疑问，也可以通过电话直接与我们联系。</p>
					<div>
						<form id="form1" name="form1" method="post" action="<?php echo site_url('guestbook/add') ?>" onsubmit="return chkmsg()">
						<table class="sextable">
							<tr>
								<th><span class="marked">姓名：</span></th>
								<td><input name="name" type="text" id="name" maxlength="50" class="basic-input" /></td>
								<td colspan="3"><span class="marked">电子邮箱：</span>
									<input name="email" type="text" id="email" maxlength="100"  class="basic-input" />
								</td>
							</tr>
							<tr>
								<th><span class="marked">主题：</span></th>
								<td colspan="3"><input name="title" type="text" id="title"  style="width:450px;"/></td>
							</tr>
							<tr>
								<th><span>内容：</span></th>
								<td colspan="3"><textarea type="text" style="width:450px;height:100px;" name="content" id="content"></textarea></td>
							</tr>
							<tr>
								<th>客户地址：</th>
								<td colspan="3"><input type="text" style="width:450px;" id="address" name="address"/></td>
							</tr>
							<tr>
								<th>联系电话：</th>
								<td><input name="phone" type="text" id="phone" size="20" maxlength="20"  class="basic-input" /></td>
								<th colspan="2">
									<span class="marked">验证码：<input type="text" id="yzm" name="yzm" style="width:60px;"/></span>
									请填入计算结果<?php echo $yzm; ?>？
									<!-- <a href="###" class="ver_code"><img src="css/skin/ver_code.png" style="vertical-align:middle;"/></a>&nbsp;&nbsp;<a href="###" class="change_code">看不清,换一张？</a> -->
								</th>
							</tr>
							<tr>
								<th>&nbsp;</th>
								<td colspan="3">
									<input type="submit" style="padding:2px 15px;" value="确认并反馈给我们"/>&nbsp;&nbsp;&nbsp;&nbsp;<a href="###">清空重写</a>
								</td>
							</tr>
						</table>
						</form>
					</div>
				</div>
			</div>
		</div>
	</section>
	<!-- end -->
	<!-- 通用尾 -->
	<?php $this->load->module('inc/home_made/jrfooter') ?>
	<!-- end -->
</body>
<script src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/favourite.js"></script>

<script src="/resources/scripts/h.js" type="text/javascript"></script>
<script src="/resources/scripts/jquery.validate.min.js" type="text/javascript"></script>
<script>
function chkmsg(){
	var a = $h.load('guestbook/chkyzm','yzm='+$('#yzm').val());
	if(a!='1'){
		$h.alert('验证码错误，请填写计算答案');
		return false;
	}

}
$().ready(function() {
 $("#form1").validate({
        rules: {
   title: "required",
	content:"required",   	name:"required",	phone:"required", yzm:"required"
   },
    messages: {
   title: "请输入主题",
	content:"请输入内容",	name:"请输入您的称呼",	phone:"有了电话方便联系", yzm:"写上验证码请"}
 });
});
</script>
</html>